import request from '@/utils/request'

export default {
  //获取用户List
  getTeacherList(current, limit, userQuery) {
    return request({
      url: `/intern/stu-teach/list/${current}/${limit}`,
      method: 'post',
      //userQuery条件对象，后端使用RequestBody获取数据
      //data表示把对象转换json进行传递到接口里面
      data: userQuery
    })
  },

    //获取简单的教师List （远程搜索使用）
    getSampleTeacherList() {
      return request({
        url: `/intern/stu-teach/list`,
        method: 'get'
      })
    },
  

  //添加教师对应学生
  addTeachStu(tid, sid) {
    return request({
      url: `/intern/stu-teach/addStuTeach`,
      method: 'post',
      data: {
        tid,
        sid
      }
    })
  },

  //通过tid获取对应的学生list
  getStudentListByTid(tid) {
    return request({
      url: `/intern/stu-teach/stuListByTid/${tid}`,
      method: 'get'
    })
  },

  //通过sid移除学生教师表
  deleteStuTeach(sid) {
    return request({
      url: `/intern/stu-teach/removeStuTeach/${sid}`,
      method: 'delete'
    })
  },

  //逻辑删除教师
  deleteTeacher(tid) {
    return request({
      url: `/intern/stu-teach/removeTeacher/${tid}`,
      method: "delete"
    })
  },

  //添加教师
  addTeacher(user) {
    return request({
      url: `/intern/stu-teach/add`,
      method: "post",
      data: user
    })
  }

}
